package Pattern.SingletonPattern;

public class Singleton1 { //懒汉式
    private static  Singleton1 instance;
    public Singleton1() {
    }
    public static synchronized Singleton1 getInstance(){
        if(instance == null){
            instance = new Singleton1();
        }
        return instance;
    }

}
